home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 157 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. From: TABATA Tomohira <loba@k2.t.u-tokyo.ac.jp>
  2. Message-ID: <199601290522.OAA29067@k4.k2.t.u-tokyo.ac.jp>
  3. X-Original-Date: Mon, 29 Jan 1996 14:22:37 +0900
  4. Path: in1.uu.net!bounce-back
  5. Date: 29 Jan 96 06:37:58 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Organization: -
  8. Newsgroups: comp.std.c++
  9. Subject: ambiguous typedef
  10. Reply-To: loba@k2.t.u-tokyo.ac.jp
  11. X-Mailer: Mew version 1.02 on Emacs 19.28.1, Mule 2.3
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMQxrh+EDnX0m9pzZAQFnKgF7B0Yxp1e2RqFqPl6ppTdSCAEmF8kmCirO
  14.     TCbURpLCC+c1ltdOiobcZaAc/82I2jYP
  15.     =MuuS
  16.  
  17. Hi, there.
  18.  
  19. Can't I use this declaration successfully?
  20.  
  21.    class T1 {
  22.    public:
  23.       typedef T1 myclass;
  24.    };
  25.  
  26.    class T2 {
  27.    public:
  28.       typedef T2 myclass;
  29.    };
  30.  
  31.    class T3 : public T1, T2 {
  32.    public:
  33.       typedef T3 myclass;
  34.    };
  35.  
  36. By gcc-2.7.1 this cannot be compiled because of "request for member
  37. `myclass' is ambiguous" on the line "typedef T3 myclass;".
  38.  
  39. I cannot find description on this matter in DWP.
  40.  
  41. This quetion was indicated originally by
  42. yamada@ch0sw001.bkc.ritsumei.ac.jp.
  43.  
  44. ------
  45.    Tomohira Tabata    loba@k2.t.u-tokyo.ac.jp
  46.    Department of Mathematical Engineering and Information Physics,
  47.    Faculty of Engineering, University of Tokyo, Japan
  48.    TEL: +81-3-3812-2111 ext. 6902     FAX: +81-3-5800-6969
  49. ---
  50. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  51.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  52.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  53.